# 字典的定义
print({})
print(dict())
print({"name": "hsylient"})

# 数据获取
student_info = {"name": "hsylient", "年龄": 22, "height": 1.85, "爱好": "看视频"}
print("name", student_info['name'], sep=":")
print("age", student_info['年龄'], sep=":")
print("身高", student_info['height'], sep=":")

# 多层数据获取
stu_score_dict = {
    "王力鸿": {
        "语文": 77,
        "数学": 66,
        "英语": 33,
    },
    "周杰轮": {
        "语文": 88,
        "数学": 86,
        "英语": 55,
    },
    "林俊杰": {
        "语文": 99,
        "数学": 96,
        "英语": 66
    }
}
print("林俊杰英语得分", stu_score_dict['林俊杰']['英语'], sep=":")


# 修改value值
student_info['name'] = '小羊哥'
print(student_info)
student_info['name'] = '郑浩'
print(student_info)

# 删除某个属性
student_info.pop('name')
print(student_info)

# 这个只能的到key的视图
print(student_info.keys())
print(list(student_info.keys()))

print("--------------------------")
for e in student_info:
    print(e)
    print(student_info.get(e))

info_dict = {
    "王力鸿": {
        "部门": "科技部",
        "工资": 300,
        "级别": 1
    },
    "周杰轮": {
        "部门": "市场部",
        "工资": 500,
        "级别": 2
    },
    "林俊节": {
        "部门": '市场部',
        "工资": 100,
        "级别": 1
    },
    "张学油": {
        "部门": "科技部",
        "工资": 400,
        "级别": 1
    },
    "刘德滑": {
        "部门": "市场部",
        "工资": 600,
        "级别": 2
    }
}

for e in info_dict:
    if info_dict.get(e).get('级别') == 1:
        info_dict.get(e)['级别'] = 2
        info_dict.get(e)['工资'] += 1000

print(info_dict)
